package com.youlai.system.converter;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.youlai.system.model.bo.UserBO;
import com.youlai.system.model.bo.UserFormBO;
import com.youlai.system.model.entity.CarUser;
import com.youlai.system.model.form.UserForm;
import com.youlai.system.model.vo.CarUserPageVO;
import com.youlai.system.model.vo.UserImportVO;
import com.youlai.system.model.vo.UserInfoVO;
import com.youlai.system.model.vo.UserPageVO;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * 用户对象转换器
 *
 * @author haoxr
 * @since 2022/6/8
 */
@Mapper(componentModel = "spring")
public interface CarUserConverter {


    CarUserPageVO toPageVo(CarUserPageVO bo);

    Page<CarUserPageVO> toPageVo(Page<CarUserPageVO> bo);

    UserForm bo2Form(UserFormBO bo);

    UserForm entity2Form(CarUser entity);

    @InheritInverseConfiguration(name = "entity2Form")
    CarUser form2Entity(UserForm entity);

    @Mappings({
            @Mapping(target = "userId", source = "userId")
    })
    UserInfoVO toUserInfoVo(CarUser entity);

    CarUser importVo2Entity(UserImportVO vo);

}
